// package com.maxatime.matrix.quartzx;
//
//import java.text.SimpleDateFormat;
//import java.util.Date;
//
//import org.apache.logging.log4j.LogManager;
//import org.apache.logging.log4j.Logger;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.mail.SimpleMailMessage;
//import org.springframework.mail.javamail.JavaMailSender;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//
//import com.maxatime.util.ValidateCodeUtils;
//
//@Configuration
//@EnableScheduling
//public class SimpleSchedule {
//    //每五秒执行一次
//	@Autowired
//    private JavaMailSender mailSender;
//	
//	Logger log = LogManager.getLogger();
//
//    @Scheduled(cron="*/1 * * * * ?")
//    public void schedule(){
//    	
//    	
//        System.out.println("执行定时任务..."+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
//        String code = ValidateCodeUtils.generateValidateCode(6).toString();
//		SimpleMailMessage message = new SimpleMailMessage();
//		 message.setFrom("15910347212@163.com");//发件人
//	     message.setTo("1");//收件人
//	     message.setSubject("短信验证");
//	     message.setText("您的验证码为：" + code + ",这是一封测试邮件请勿回复！！！。我嫩爹");
//	     try {
//	            mailSender.send(message);
//	            log.info("send success.................");
//	        } catch (Exception e) {
//	            log.error("异常", e);
//	        }
//    }
//}